package cn.hh.basic.util;

import lombok.Data;
/*返回错误信息方法*/
@Data
public class AjaxResult {
    /*判断结果，默认为正确*/
    private Boolean success=true;
    /*未报错返回字符串*/
    private String message="操作成功";
    /*报错信息代码填充*/
    private Object resultObj;
    /*报错信息填充方法*/
    public static AjaxResult me(){
        return new AjaxResult();
    }

    /*链式写法*/
    public AjaxResult setSuccess(Boolean success){
        this.success = success;
        return this;
    }
    /*报错信息自动设置字符串填充*/
    public AjaxResult setMessage(String message) {
        this.success = false;
        this.message = message;
        return this;
    }
    /*报错信息代码填充*/
    public AjaxResult setResultObj(Object resultObj) {
        this.resultObj = resultObj;
        return this;
    }
}
